package com.block.risk.service.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.block.db.entity.MemberExtInfo;
import com.block.db.entity.RiskConfigFilterInfo;
import com.block.db.entity.RiskConfigInfo;
import com.block.db.mapper.RiskConfigFilterInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.block.risk.enums.FilterAbleStatusEnum;
import com.block.risk.model.result.RiskControlResult;
import com.block.risk.service.IRiskConfigFilterInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 风控条件过滤配置 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-07-24
 */
@Service
public class RiskConfigFilterInfoServiceImpl extends ServiceImpl<RiskConfigFilterInfoMapper, RiskConfigFilterInfo> implements IRiskConfigFilterInfoService {


    @Override
    public RiskControlResult filterConfigInfo(RiskConfigInfo riskConfigInfo, MemberExtInfo memberExtInfo){

        /**
         * 查询不推送的信息
         */



        RiskControlResult controlResult = new RiskControlResult();

        return controlResult;

    }

    /**
     * 不推送的渠道信息
     * @return
     */
    public String notFilterChannel(Integer configId, String channelCode){

        List<RiskConfigFilterInfo> unableStatusList = this.baseMapper.getListUnableStatus(configId, channelCode, FilterAbleStatusEnum.UNABLE.getValue());
        if (CollUtil.isEmpty(unableStatusList)){
            // 没有需要禁止渠道信息
            return null;
        }

        for (RiskConfigFilterInfo configFilterInfo : unableStatusList) {
            if (StrUtil.equals(configFilterInfo.getDataId(), channelCode)){

            }
        }





        return null;
    }







}
